package com.cms.lang.jpa;

import java.io.Serializable;
import java.util.List;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.NoRepositoryBean;

import com.cms.lang.util.QueryParams;

@NoRepositoryBean
public interface BaseRepository<T, ID extends Serializable> extends JpaRepository<T, ID>, JpaSpecificationExecutor<T> {

	Page<T> findAll(Specification<T> spec, Pageable pageable, String distinctColumnName);

	List<T> findAll(Specification<T> spec, String distinctColumnName);

	List<T> findAll(ID[] idArr);

	Page<T> findAll(Specification<T> spec, Pageable pageable, String... distinctColumnName);

	List<T> findByQueryParam(QueryParams<T> queryParams, Pageable pageable);

	void update(T t);

}